<?php

namespace app\admin\model;

use think\model\Relation;

class LocationDetail extends Relation {

        protected $link = [
            'location' => [
                'mapping_type' => BELONGS_TO,
                'class_name' => 'Location',
                'foreign_key' => 'location_id',
                'mapping_fields' => 'name as location_name',
                'as_fields' => 'location_name',
                'parent_key' => 'id'
            ]
        ];

}
